package com.jt.service;

import com.jt.dao.LogMapper;
import com.jt.pojo.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService{
    @Autowired
    private LogMapper logMapper;
    @Async//异步执行（创建一个新的线程来执行），优点：不会长时间阻塞web服务(例如tomcat)线程
    @Override
    public void insertLog(Log log) {
        logMapper.insert(log);
    }
}
